<?php
header("Content-Type: text/html;charset=utf-8"); 
require_once '../model/PdoMySQL.class.php';
require_once '../model/config.php';
//error_reporting(0);
	 class Time{
		public static function query($table='',$id=''){
			 $pdo=new PdoMySQL();
			$sql="select regtime from {$table} where id={$id};";
			$stmt = $pdo->getRow($sql);
			$pdo->execute($sql);
			$startdate=$stmt['regtime'];
			$enddate= date('Y-m-d H:i:s');
		$date=floor((strtotime($enddate)-strtotime($startdate))/86400);
$hour=floor((strtotime($enddate)-strtotime($startdate))%86400/3600);
$minute=floor((strtotime($enddate)-strtotime($startdate))%86400/60);
$second=floor((strtotime($enddate)-strtotime($startdate))%86400%60);
echo $date."天<br>";
echo $hour."小时<br>";
echo $minute."分钟<br>";
echo $second."秒<br>";
		}
}

 ?>